package com.blue.jdbc.dao;

import org.springframework.stereotype.Repository;

import com.blue.jdbc.BaseDao;
import com.blue.jdbc.model.Menu;

@Repository
public class MenuDao extends BaseDao<Menu>
{
	public MenuDao()
	{
	}

	@Override
	protected void query(StringBuilder sql, Menu param)
	{
		if (param != null)
		{
			if (param.getState() != null)
				sql.append(" and a.state=:state");
			
			if (param.getParentId() != null)
				sql.append(" and a.parent_id=:parentId");
		}
		sql.append(" order by a.sort");
	}
	
	
	
}
